/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// picon.hpp - Definition of PegIcon class.
//
// Author: Kenneth G. Maxwell
//
// Copyright (c) 1997-2000 Swell Software
//              All Rights Reserved.
//
// Unauthorized redistribution of this source code, in whole or part,
// without the express written permission of Swell Software
// is strictly prohibited.
//
// Notes:
//
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef _PEGICON_
#define _PEGICON_

/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
class PegIcon : public PegThing
{
    public:
        PegIcon(PegThing *, PEGUINT BitmapId = 0,
                PEGUSHORT Id = 0, PEGULONG Style = FF_NONE);
        PegIcon(const PegRect &Where, PEGUINT BitmapId = 0, PEGUSHORT Id = 0,
                PEGULONG Style = FF_NONE);
        PegIcon(PEGUINT BitmapId = 0, PEGUSHORT Id = 0,
                PEGULONG Style = FF_NONE);
        virtual ~PegIcon() {}

        virtual void Draw(const PegRect &Invalid);
        PegBitmap *GetBitmap(void){return mpBitmap;}
        PEGUINT GetIcon(void){return mBitmapId;}
        PegThing *GetProxy(void) {return mpProxy;}
        virtual PEGINT Message(const PegMessage &Mesg);

        virtual void SetIcon(PEGUINT BitmapId)
        {
            mBitmapId = BitmapId;
            Invalidate();
        }

        virtual void SetIcon(PegBitmap *pBitmap)
        {
            mBitmapId = 0;
            mpBitmap = pBitmap;
            Invalidate();
        }

        void SetProxy(PegThing *pNew) {mpProxy = pNew;}

    protected:
        PegThing *mpProxy;
        PegBitmap *mpBitmap;
        PEGUINT mBitmapId;
};


#endif

